package com.fcscs.cservice.gwt.client;

import java.util.List;
import java.util.Map;

import com.fcscs.cservice.common.CServiceCommonEnums.EditableCategoryEnum;
import com.fcscs.cservice.domain.AuthenticationConfig;
import com.fcscs.cservice.domain.ConstantsLanguageValue;
import com.fcscs.cservice.domain.Country;
import com.fcscs.cservice.domain.DedicatedVideoConfig;
import com.fcscs.cservice.domain.ExpressCheckInConfig;
import com.fcscs.cservice.domain.FieldEditability;
import com.fcscs.cservice.domain.HouseKeepingConfig;
import com.fcscs.cservice.domain.IGuestUserProfileView;
import com.fcscs.cservice.domain.IGuestUserView;
import com.fcscs.cservice.domain.InterfaceConfig;
import com.fcscs.cservice.domain.InterfaceConfiguration;
import com.fcscs.cservice.domain.Language;
import com.fcscs.cservice.domain.Nationality;
import com.fcscs.cservice.domain.PaymentMethod;
import com.fcscs.cservice.domain.RoomStatus;
import com.fcscs.cservice.domain.State;
import com.fcscs.cservice.domain.Title;
import com.fcscs.cservice.domain.model.CountryView;
import com.fcscs.cservice.domain.model.EditabilityConf;
import com.fcscs.cservice.domain.model.ReservationConfView;
import com.fcscs.cservice.domain.model.StateView;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

@RemoteServiceRelativePath("../gwt/cserviceCommon")
public interface CServiceCommonService extends RemoteService {

	/**
	 * get a list of countries configured by property id
	 * @param propId
	 * @return
	 */
	List<CountryView> getCountryViewList(long propId);

	/**
	 * get a list of states configured by property id
	 * @param propId
	 * @return
	 */
	List<StateView> getStateViewList(long countryId);

	/**
	 * get reservation configuration data, including titles, languages, payment methods...
	 * @return
	 */
	ReservationConfView getRsvConfView(long propId);

	List<Country> getCountryList(long propId);

	Country saveCountry(Country country);

	List<State> getStateList(long countryId);

	State saveState(State state);

	List<Title> getTitleList(long propId);

	Title saveTitle(Title title);

	List<Language> getLanguageList(long propId);

	Language saveLanguage(Language language);

	List<PaymentMethod> getPayMethodList(long propId);

	PaymentMethod savePayMethod(PaymentMethod payMethod);

	List<Nationality> getNationalityList(long propId);

	Nationality saveNationality(Nationality nationality);

	List<RoomStatus> getRoomStatusList(long propId);

	RoomStatus saveRoomStatus(RoomStatus roomStatus);

/*	List<ReservationStatus> getRsvStatusList(long propId);

	ReservationStatus saveReservationStatus(ReservationStatus reservationStatus);*/

	boolean isCountryTaken(long propId, String country, Long id);

	boolean isStateTaken(long propId, long countryId, String state, Long id);

	boolean isTitleTaken(long propId, String title, Long id);

	boolean isLanguageTaken(long propId, String language, Long id);

	boolean isNationalityTaken(long propId, String nationality, Long id);

	boolean isPayMethodTaken(long propId, String method, Long id);

	boolean isRsvStatusTaken(long propId, String status, Long id);

	boolean isRoomStatusTaken(long propId, String status, Long id);

	boolean isPropertyConfTaken(long orgId, long propId, Long id);

	boolean deleteCountry(Country country);
	
	void permDeleteCountry(Country country);
	
	boolean deleteState(State state);
	
	void permDeleteState(State state);
	
	boolean deleteTitle(Title title);
	
	void permDeleteTitle(Title title);
	
	boolean deleteLanguage(Language language);
	
	void permDeleteLanguage(Language language);
	
	boolean deleteNationality(Nationality nationality);
	
	void permDeleteNationality(Nationality nationality);
	
	boolean deletePayMethod(PaymentMethod method);
	
	void permDeletePayMethod(PaymentMethod method);
	
/*	boolean deleteRsvStatus(ReservationStatus status);
	
	void permDeleteRsvStatus(ReservationStatus status);*/
	
	boolean deleteRoomStatus(RoomStatus status);
	
	void permDeleteRoomStatus(RoomStatus status);

	/**
	 * get field editability configuration
	 * @param propId property id
	 * @param categories null if query all editable categories
	 * @return
	 */
	EditabilityConf getEditabilityConf(long propId, List<EditableCategoryEnum> categories);

	/**
	 * update field editability configuration
	 * @param fieldEditList for existing field, id should be valid id. if id is null, will create new record
	 * @return
	 */
	List<FieldEditability> updateFieldEditability(List<FieldEditability> fieldEditList);
	
    InterfaceConfiguration saveInterfaceConf(InterfaceConfiguration conf);
	
	InterfaceConfiguration getInterfaceConf(long propId);
	
	List<IGuestUserView> getListIGuestUserView();
	//iGuest Authen

		AuthenticationConfig getAuthen(long id, long orgId);
		AuthenticationConfig SaveAuthen(AuthenticationConfig authen);
	// Multi Language	
	Map<String, String> getLanguageMap();
	
	IGuestUserProfileView getIGuestUserProfileView();
	
	ExpressCheckInConfig saveExpressCheckInConfig(ExpressCheckInConfig expressCheckIn);

	ExpressCheckInConfig getExpressCheckInConfig(long id);

	DedicatedVideoConfig getDelicatedVideo(long propId, long orgId);

	DedicatedVideoConfig saveDelicatedVideo(DedicatedVideoConfig delicatevideo);

	ConstantsLanguageValue saveConstantsLanguageValue(
			ConstantsLanguageValue constants);

	List<ConstantsLanguageValue> getListConstantsLanguage(long propId,
			long orgId, String constants);

	HouseKeepingConfig saveHousepeepingConfig(
			HouseKeepingConfig currentHousekeepingConf);

	HouseKeepingConfig getHousekeepingConfig(long propertyId);

	InterfaceConfig getInterfaceConfig(Long propertyId);

	InterfaceConfig saveInterfaceConfig(InterfaceConfig currentInterConf);
}
